import Stack from '../useQueue'
import Assert from '@/utils/assets'

export const test = () => {
    const stack = new Stack();
    const assert = new Assert();

    assert.type('size').expect(stack.size()).toBe(0)
    assert.type('isEmpty').expect(stack.isEmpty()).toBe(true)

    stack.push(1);
    stack.push(2);
    assert.type('size').expect(stack.size()).toBe(2)
    // assert.type('isEmpty').expect(stack.isEmpty()).toBe(false)
    assert.type('top').expect(stack.top()).toBe(2)
    assert.type('pop').expect(stack.pop()).toBe(2)
    assert.type('top').expect(stack.top()).toBe(1)
    assert.type('size').expect(stack.size()).toBe(1)
    stack.push(3);
    stack.push(4);
    stack.push(5);
    stack.forEach((ele, i) => {
        console.log(ele)
        return false
    })

    // stack.clear();
    // assert.type('top').expect(stack.top()).toBe(undefined)
    // assert.type('size').expect(stack.size()).toBe(0)
    // assert.type('isEmpty').expect(stack.isEmpty()).toBe(true)
}



